//
//  ColorMarcro.h
//  CommonLibrary
//
//  Created by Alexi on 13-10-23.
//  Copyright (c) 2013年 ywchen. All rights reserved.
//

#ifndef CommonLibrary_ColorMarcro_h
#define CommonLibrary_ColorMarcro_h




#define RANDOM_COLOR RGB_COLOR(arc4random() % 255, arc4random() % 255, arc4random() % 255)
#define RGB_COLOR(r,g,b) RGB_COLOR_ALPHA(r,g,b,1)
#define RGB_COLOR_ALPHA(r,g,b,alpah) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(alpah)]



#define NORMALCOLOR RGB_COLOR(277,144,0)

#define BG_WHITE RGB_COLOR(255, 255, 255)

#define TEXT_WHITE_H  RGB_COLOR(255, 255, 255)
#define TEXT_WHITE_M  RGB_COLOR(67, 67, 67)
#define TEXT_WHITE_L  RGB_COLOR(86, 86, 86)

#define BG_GRAY_H  RGB_COLOR(215, 215, 215)
#define BG_GRAY_M  RGB_COLOR(220, 220, 220)
#define BG_GRAY_L  RGB_COLOR(238, 238, 238)
#define BG_GRAY_SL  RGB_COLOR(248, 248, 248)

#define TEXT_RED_H RGB_COLOR(229,53,79)
#define TEXT_RED_M RGB_COLOR(229,53,79)
#define TEXT_RED_L RGB_COLOR(237,74,51)

#define TEXT_GRAY_H  RGB_COLOR(95, 95, 95)
#define TEXT_GRAY_M  RGB_COLOR(150, 150, 150)
#define TEXT_GRAY_L RGB_COLOR(183, 183, 183)


#define TEXT_BlACK_H  RGB_COLOR(12, 12, 12)
#define TEXT_BlACK_M  RGB_COLOR(67, 67, 67)
#define TEXT_BlACK_L  RGB_COLOR(86, 86, 86)

#define TEXT_ORINGE_M    RGB_COLOR(235,131,96)




// 取色值相关的方法
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 \
alpha:1.0]



#define RGB(r,g,b)          [UIColor colorWithRed:(r)/255.f \
green:(g)/255.f \
blue:(b)/255.f \
alpha:1.f]

#define RGBA(r,g,b,a)       [UIColor colorWithRed:(r)/255.f \
green:(g)/255.f \
blue:(b)/255.f \
alpha:(a)]

#define RGBOF(rgbValue)     [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 \
alpha:1.0]

#define RGBA_OF(rgbValue)   [UIColor colorWithRed:((float)(((rgbValue) & 0xFF000000) >> 24))/255.0 \
green:((float)(((rgbValue) & 0x00FF0000) >> 16))/255.0 \
blue:((float)(rgbValue & 0x0000FF00) >> 8)/255.0 \
alpha:((float)(rgbValue & 0x000000FF))/255.0]

#define RGBAOF(v, a)        [UIColor colorWithRed:((float)(((v) & 0xFF0000) >> 16))/255.0 \
green:((float)(((v) & 0x00FF00) >> 8))/255.0 \
blue:((float)(v & 0x0000FF))/255.0 \
alpha:a]

#define KUIColorARGBString(a)       [UIColor colorWithARGBString:a]


// 定义通用颜色
#define kBlackColor         [UIColor blackColor]
#define kDarkGrayColor      [UIColor darkGrayColor]
#define kLightGrayColor     [UIColor lightGrayColor]
#define kWhiteColor         [UIColor whiteColor]
#define kGrayColor          [UIColor grayColor]
#define kRedColor           [UIColor redColor]
#define kGreenColor         [UIColor greenColor]
#define kBlueColor          [UIColor blueColor]
#define kCyanColor          [UIColor cyanColor]
#define kYellowColor        [UIColor yellowColor]
#define kMagentaColor       [UIColor magentaColor]
#define kOrangeColor        [UIColor orangeColor]
#define kPurpleColor        [UIColor purpleColor]
#define kClearColor         [UIColor clearColor]

#define kRandomFlatColor    [UIColor randomFlatColor]

#endif

